package com.lzx.adx.report.support.context.v3;

import com.lzs.adx.commmon.utils.SpringContextUtils;
import com.lzx.adx.report.support.strategy.v2.media.AbstractCallback;
import com.lzx.adx.report.support.strategy.v3.media.AbstractChannel;

import java.util.Map;

public class CallBackV3Context {

    private Map<String,Class> callBackReport;

    public CallBackV3Context(Map<String,Class> callBackReport){
        this.callBackReport=callBackReport;
    }


    public AbstractChannel getCallBack(String reportType){
        Class aClass = callBackReport.get(reportType);
        if(aClass==null){
            throw new RuntimeException("没有找到对应的产品");
        }
        return (AbstractChannel) SpringContextUtils.getBean(aClass);
    }
}
